package com.project.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.time.LocalDate;
import java.util.List;

/**
 * 订单表
 */
@Data
@TableName("t_order")
public class OrderBean {
    /**
     * id
     */
    @TableId(value = "pk_order",type = IdType.AUTO)
    private Integer id;
    /**
     * 订单编号
     */
    @TableField("orderNum")
    private String orderNum;
    /**
     * 付款总额
     */
    @TableField("totalPrice")
    private double totalPrice;
    /**
     * 日期
     */
    @TableField("date")
    private LocalDate date=LocalDate.now() ;
    /**
     * 订单状态
     */
    @TableField("status2")
    private String status;
    /**
     * 地址详情
     */
    @TableField("address")
    private String address;
    /**
     * 支付方式
     */
    @TableField("modeOfPayment")
    private String modeOfPayment;
    /**
     * 客户名
     */
    @TableField("customerName")
    private String customerName;
    /**
     * 客户电话
     */
    @TableField("phone")
    private String phone;
    /**
     * 订单明细集合
     */
    @TableField(exist = false)
    private List<OrderInfoBean> orderInfoList;

    public OrderBean() {
    }

    public OrderBean(String orderNum, double totalPrice, String status, String address, String modeOfPayment, String customerName, String phone) {
        this.orderNum = orderNum;
        this.totalPrice = totalPrice;
        this.status = status;
        this.address = address;
        this.modeOfPayment = modeOfPayment;
        this.customerName = customerName;
        this.phone = phone;
    }
}
